#!/usr/bin/env bash
set -ex

# (since we skip pam_systemd)

runtime_dir="/run/user/${SLURM_JOB_UID}"
if [ ! -d "${runtime_dir}" ]; then
    mkdir -p "${runtime_dir}"
fi
if ! findmnt "${runtime_dir}" >/dev/null ; then
    mount -t tmpfs -o uid="${SLURM_JOB_UID}",mode=0700 tmpfs "${runtime_dir}"
fi
